import React, { Component } from 'react'
import { Route,Switch,Redirect } from 'react-router-dom'
import MyNavLink from '../MyNavLink/MyNavLink'
import Message from './Message/Message'
import News from './News/News'
import './Home.css'

export default class Home extends Component {
  render() {
    return (
      <div>
        <h2>Home组件内容</h2>
        <div>
          <ul className="nav nav-tabs">
            <MyNavLink to='/home/news'>News</MyNavLink>
            <MyNavLink to='/home/message'>Message</MyNavLink>
            {/* <NavLink className='list-group-item' to='/home/news'>News</NavLink>
            <NavLink className='list-group-item' to='/home/message'>message</NavLink> */}
            {/* <li>
              <a class="list-group-item" href="./home-news.html">News</a>
            </li>
            <li>
              <a class="list-group-item active" href="./home-message.html">Message</a>
            </li> */}
          </ul>
          <div>
            <Switch>
              <Route path='/home/news' component={News}/>
              <Route path='/home/message' component={Message}/>
              <Redirect to='/home/news'/>
            </Switch>
          </div>
        </div>
      </div>
    )
  }
}
